100	'  EXIT38.ASC, version 07/17/85
102	'  Exit RCP/M system with Comments
104	'   For use with RBBS38 
106	'       By Dennis Recla
108 	'
120	' First find out where the LASTCALR file is
122	'
130	DEFINT A-Z
135	DIM H(6),HT(6),HD(6),TOD(5),DOY(5)
140	ERS$=CHR$(8)+" "+CHR$(8)
150 	DSK$="A:"
155	CRLF$=CHR$(13)+CHR$(10)
160	'
200	OPEN "I",1,DSK$+"BOOTPWD":IF EOF(1) THEN 300
210	INPUT #1,DSK2$,DSK3$
220	'
230	'DSK2$ is location of COMMENTS file.
240	'DSK3$ is location of LASTCALR file.
250	'
300	CLOSE #1
320	'
340	OPEN "I",1,DSK3$+"LASTCALR":INPUT #1,N$,O$,D$:CLOSE
350     IF N$="SYSOP" THEN 940
360	PRINT
380	PRINT N$+" "+O$+"  Want to leave any comments (Y/N)? ";:C=1:GOSUB 980:C=0
400	IF LEFT$(B$,1)="N" OR LEFT$(B$,1)="n" THEN 720
420	IF LEFT$(B$,1)<>"Y" AND LEFT$(B$,1)<>"y" THEN 380
440	PRINT
460	OPEN "R",1,DSK2$+"COMMENTS.",65:FIELD#1,65 AS RR$
480	GET#1,1:RE=VAL(RR$)+1:RL=65
500	IF RE=1 THEN RE=2
520	S$=CRLF$+"From: "+N$+" "+O$+"  "+D$+"  ( On Exit)":GOSUB 1200
540	PUT#1,RE
560	PRINT "Enter comments, <return> to end, (16 lines max)"
580	PRINT
600	PRINT "-->";
620	GOSUB 980
640	IF B$="" THEN 700	
660	RE=RE+1:S$=B$:RL=65:GOSUB 1200:PUT#1,RE 
680	GOTO 600
700	S$=STR$(RE):RL=65:GOSUB 1200:PUT#1,1:CLOSE
720 'COME HERE TO EXIT
920	PRINT
940	RUN "A:SUPER.COM"
960	END
980	'
1000	'  Accept string into B$ from console
1020	'
1040	GOSUB 1320
1060	B$=SAV$
1080	IF LEN(B$)=0 THEN RETURN
1100	IF C=0 THEN 1180
1120	FOR ZZ=1 TO LEN(B$)
1140	MID$(B$,ZZ,1)=CHR$(ASC(MID$(B$,ZZ,1))+32*(ASC(MID$(B$,ZZ,1))>96))
1160	NEXT ZZ
1180	RETURN
1200	'
1220	'  Fill and store disk record
1240	'
1260	LSET RR$=LEFT$(S$+SPACE$(RL-2),RL-2)+CHR$(13)+CHR$(10)
1280	RETURN
1300	'
1320	CHC=0:SAV$=""
1340	NCH=ASC(INPUT$(1))
1360	IF NCH=127 THEN	1500
1380	IF NCH<32 THEN 1560
1400	IF CHC>=62 THEN PRINT CHR$(7);:GOTO 1340
1420	SAV$=SAV$+CHR$(NCH):CHC=CHC+1:PRINT CHR$(NCH);
1440	IF CHC=55 THEN PRINT CHR$(7);
1460	GOTO 1340
1480	'
1500	IF CHC=0 THEN 1340 ELSE PRINT RIGHT$(SAV$,1);:GOTO 1540
1520	IF CHC=0 THEN 1340 ELSE PRINT ERS$;
1540	CHC=CHC-1:SAV$=LEFT$(SAV$,CHC):GOTO 1340
1560	IF NCH=8 THEN 1520
1580	IF NCH=13 THEN PRINT:RETURN
1600	IF NCH=21 THEN PRINT " #":GOTO 1320
1620	IF NCH<>24 OR CHC=0 THEN 1340
1640	FOR BCC=1 TO CHC:PRINT ERS$;:NEXT BCC:GOTO 1320
